-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix unknowns not present in initialization system in linearization #2809
fix: fix unknowns not present in initialization system in linearization #2809
Conversation
f97dae6
to
1754cc9
Compare
Test the case I described, |
Does this test work? It passed locally, just making sure it's what you're looking for |
No it needs to be structurally simplified. |
src/systems/abstractsystem.jl
Outdated
@@ -2002,7 +2002,9 @@ function linearization_function(sys::AbstractSystem, inputs, | |||
p = todict(p) | |||
newps = deepcopy(sys_ps) | |||
for (k, v) in p | |||
setp(sys, k)(newps, v) | |||
if is_parameter(sys, p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if there is something for which !is_parameter(sys, p)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bug, thanks 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, you fixed something other than I had in mind actually, let me rephrase the question after the fix
what happens if there is something for which !is_parameter(sys, k)
?
note p -> k
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Well that piece of code handles parameters specified as a Dict
. Its sole purpose is to update the MTKParameters
object. If k
is not a parameter, it's not in the parameter object, so it's ignored. If it's an unknown, it's already taken care of in u
.
|
c835625
to
7442618
Compare
7442618
to
3e81ea4
Compare
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.